package idv.kikka.server.config;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public abstract class JdbcConfig {
    static Properties properties;
    static {
        try (InputStream in = JdbcConfig.class.getResourceAsStream("/application.properties")) {
            properties = new Properties();
            properties.load(in);
        } catch (IOException e) {
            throw new ExceptionInInitializerError(e);
        }
    }
    //获取jdbc的配置
    public static String getJdbcDriver(){
        return properties.getProperty("jdbc.driver");
    }
    public static String getJdbcUrl(){
        return properties.getProperty("jdbc.url");
    }
    public static String getJdbcUsername(){
        return properties.getProperty("jdbc.username");
    }
    public static String getJdbcPassword(){
        return properties.getProperty("jdbc.password");
    }
    //获取mapper的包和配置文件名
    public static String getMapperPackage(){
        return properties.getProperty("chat.mapper.package");
    }
}
